
<!DOCTYPE html>
<html>
<head>
  <title>你妹书城</title>
<!-- START:stylesheet -->
  <%= stylesheet_link_tag :all %>
  <%= stylesheet_link_tag "scaffold" %>
  <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
<!-- END:stylesheet -->
  <%= javascript_include_tag :application %>
  <%= csrf_meta_tag %><!-- <label id="code.csrf"/> -->
</head>
<body id="store">
  <div id="banner">
    <%= image_tag("logo2.png") %>
	
	
    <%= @page_title || "Ni Mei Bookstore" %><!-- <label id="code.depot.e.title"/> -->
	
	<% if session[:admin_id] %>
	<span id="logout_admin">
		<%= link_to "管理员主页", home_path, :method => :get ,id:"home_link" %>
		<%= link_to '管理员注销', logout_admin_path, :method => :delete ,id:"logout_admin" %></span>
	<% else %>
		
		<% if !session[:user_id] %>
		<span id="login">
			<%= link_to "登录",login_path ,id:"login_link" %>
			<%= link_to "注册",new_user_path ,class:"register_link" %></span>
		<% else %>
			<span id="logout">
				<% p session[:user_id]%>
				<% p session[:user_name]%>
				
				<%= link_to "欢迎您，"+session[:user_name], user_path(session[:user_id]),:method => :get ,id:"homepage_link" %>
				<%= link_to '注销', logout_path, :method => :delete, id:"logout_link" %>
			<%= link_to "注册",new_user_path, class:"register_link" %></span>
		<% end %>
	<% end %>
	
	<div class="search_form">
		
    <%= form_tag '/store/index',method: :get do %>

        <div>
          <%= text_field_tag :keyword, params[:keyword] %><%= submit_tag "搜索" %>
        </div>
      
      
    <% end %>
	</div>
	
  </div>
  <div id="columns">
    <div id="side">
		
	<font color="white"><%= Time.now.strftime("%F")%>   <%= Time.now.strftime("%T")%><br /></font>
	<font color="white"><%= Time.now.strftime("%A")%><br /></font><br />
  <% if session[:user_id] %>
         <br />
		 <% if session[:admin_id]%>
         <%= link_to '订单目录',   orders_path   %><br />
         <%= link_to '商品目录', products_path %><br />
         <%= link_to '用户目录',    users_path    %><br />
		 <% end %>
      
         <br />
         
       <% end %>
   	
	<div id="cart">
	    <!-- START_HIGHLIGHT -->
	      <!-- START:hidden_div -->
		  <% if @is_cart_show == false%>
		 	 <% if @cart%>
	     		 <%= hidden_div_if(@cart.line_items.empty?, :id => "cart") do %>
	      		  <%= render @cart %>
	    		  <% end %>
				<% end %>
		
	   	  <% end %>
		  
		  	
		  
	    <!-- END:hidden_div -->
	      <!-- END_HIGHLIGHT -->
		  
	</div>
	
		
     	<div id="footer">
	  
     	    	<a href="http://localhost:3000/">主页在浙里</a><br/><br/>
     	   		<a href="http://www..../faq">有啥问题？</a><br/><br/>
     	    	<a href="http://news.163.com/">搞个大新闻</a><br/><br/>
     	    	<a href="http://www..../contact">联系我们</a><br/><br/>
	  
     	</div>
	
    </div>
    <div id="main">
      <%= yield %><!-- <label id="code.depot.e.include"/> -->
	 
    </div>
	
	
  </div>
  
</body>


</html>
